package model;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;

public class ReadFile {
	public static void main(String[] args) throws IOException {
		int i;
		
		//khai vao mot doi tuong FileInputStream: doc du lieu theo dang byte
		FileInputStream fin;
		
		//bat loi khong tim thay file
		try {
			fin = new FileInputStream("C:/txt/b.txt");
		}
		catch(FileNotFoundException exc) {
			System.out.println("File Not Found!");
			return;
		}
		
		//doc file cho den khi gap -1
		do {
			i = fin.read();
			if(i != -1) {
				System.out.print((char)i + " ");
			}
		}
		while(i != -1);
		
		//dong stream
		fin.close();
	}

}
